<template>
	<view id="list">
		<view v-for="(item,index) in list" :key='index' @click="C_listItem(item)">
			<view>
				<view class="name">{{item.name}}</view>
				<view class="msg">{{item.msg}}</view>
			</view>
			<image :src="item.image" mode="aspectFill"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			};
		},
		onLoad(o) {
			this.def_database()
			
		},
		methods:{
			async def_database(){
				let JKmallarticles = await this.$u.api.JKmallarticles(); //健康风险防控与保险推荐介绍
				this.list = JKmallarticles.data.list
			},
			C_listItem(item){
				uni.navigateTo({
					url:'./detail/detail?db='+encodeURIComponent(JSON.stringify(item))
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #FFFFFF;
	}
	#list{
		width: 90%;
		margin: 20rpx auto;
		padding-bottom: 1rpx;
		>view{
			display: flex;
			justify-content: space-between;
			border-bottom: 1px solid rgba(0,0,0,.1);
			padding: 30rpx 0;
			>view{
				flex: .8;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.name{
					font-weight: bold;
					display: -webkit-box;
					-webkit-line-clamp: 2;//限制文本的行数，只显示两行
					-webkit-box-orient: vertical;
					overflow: hidden;
				}
				.msg{
					font-size: 24rpx;
					color: #C8C8C8;
				}
			}
			image{
				width: 170rpx;
				height: 130rpx;
				border-radius: 10rpx;
			}
		}
	}
</style>
